package com.weiyuwqj.server.service.account.module.action;

import com.weiyuwqj.server.service.account.module.DealAction;
import com.weiyuwqj.api.model.BusAccountLog;

import java.math.BigDecimal;

/**
 * Copyright 2015-2019 Yunfucloud technology co., Ltd.
 * Created by fuxx on 15/11/27.
 */
public abstract class AbstractDealAction implements DealAction {

    protected BusAccountLog log;

    public AbstractDealAction() {
        log = new BusAccountLog();
    }

    public BusAccountLog getLog() {
        return log;
    }

    @Override
    public void deal(Integer userId, BigDecimal operMoney, String remark) {
        instance(userId, operMoney, remark);
        dealAccount();
    }

    public void instance(Integer userId, BigDecimal operMoney, String remark) {
        log.setUserId(userId);
        log.setOperMoney(operMoney);
        log.setRemark(remark);
    }

    public abstract void dealAccount();


}
